#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(){
	int n;
	cin>>n; 
	ll pre=(n+1)*n/2;
	cout<<"2 1 "<<n<<endl;
	ll cur;
	cin>>cur;
	int len=cur-pre;
	int l=1,r=n;
	int ans=n;
	while(l<=r){
		int mid=l+(r-l)/2;
		ll pree;
		cout<<"1 1 "<<mid<<endl;
		cin>>pree;
		
		ll curr;
		cout<<"2 1 "<<mid<<endl;
		cin>>curr;
		if (pree==curr){
			l=mid+1;
		}else{
			ans=mid;
			r=mid-1;
		}
	}
	cout<<"! "<<ans<<" "<<ans+len-1<<endl;
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int t;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
} 
